<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">新增设备档案</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:;" class="am-icon-cog"></a>
                    </div>
                </div>
                <div class="widget-body am-fr">
                    <form class="am-form tpl-form-line-form" id="machineryInfoForm" method="post">
                        <input type="hidden" id="id" name="id"/>
                        <!--ownerName(机主名称)-->
                        <div class="am-form-group">
                            <label for="ownerName" class="am-u-sm-2 am-form-label">机主名称
                                <span class="tpl-form-line-small-title">ownerName</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="ownerName" class="tpl-form-input" placeholder="请输入"
                                       name="ownerName"/>
                            </div>
                        </div>
                        <!--identityNum(机主身份证号)-->
                        <div class="am-form-group">
                            <label for="identityNum" class="am-u-sm-2 am-form-label">机主身份证号
                                <span class="tpl-form-line-small-title">identityNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="identityNum" class="tpl-form-input" placeholder="请输入"
                                       name="identityNum"/>
                            </div>
                        </div>
                        <!--排放登记(Emission_registration)-->
                        <div class="am-form-group">
                            <label for="emissionRegistration" class="am-u-sm-2 am-form-label">排放登记
                                <span class="tpl-form-line-small-title">emissionRegistration</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="emissionRegistration" class="tpl-form-input" placeholder="请输入"
                                       name="emissionRegistration"/>
                            </div>
                        </div>
                        <!--设备编号(device_ID)-->
                        <div class="am-form-group">
                            <label for="deviceID" class="am-u-sm-2 am-form-label">设备编号
                                <span class="tpl-form-line-small-title">deviceID</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="deviceID" class="tpl-form-input" placeholder="请输入"
                                       name="deviceID"/>
                            </div>
                        </div>
                        <!--机械品牌(brands)-->
                        <div class="am-form-group">
                            <label for="brands" class="am-u-sm-2 am-form-label">机械品牌
                                <span class="tpl-form-line-small-title">brands</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="brands" class="tpl-form-input" placeholder="请输入"
                                       name="brands"/>
                            </div>
                        </div>
                        <!--机械颜色(colour)-->
                        <div class="am-form-group">
                            <label for="colour" class="am-u-sm-2 am-form-label">机械颜色
                                <span class="tpl-form-line-small-title">colour</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="colour" class="tpl-form-input" placeholder="请输入"
                                       name="colour"/>
                            </div>
                        </div>
                        <!--机械类型(type)-->
                        <div class="am-form-group">
                            <label for="type" class="am-u-sm-2 am-form-label">机械类型
                                <span class="tpl-form-line-small-title">type</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="type" class="tpl-form-input" placeholder="请输入"
                                       name="type"/>
                            </div>
                        </div>
                        <!--生产国别(country)-->
                        <div class="am-form-group">
                            <label for="country" class="am-u-sm-2 am-form-label">生产国别
                                <span class="tpl-form-line-small-title">country</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="country" class="tpl-form-input" placeholder="请输入"
                                       name="country"/>
                            </div>
                        </div>
                        <!--大架子号(big_shelf_num)-->
                        <div class="am-form-group">
                            <label for="bigShelfNum" class="am-u-sm-2 am-form-label">大架子号
                                <span class="tpl-form-line-small-title">bigShelfNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="bigShelfNum" class="tpl-form-input" placeholder="请输入"
                                       name="bigShelfNum"/>
                            </div>
                        </div>
                        <!--燃油类型(Fuel)-->
                        <div class="am-form-group">
                            <label for="fuel" class="am-u-sm-2 am-form-label">燃油类型
                                <span class="tpl-form-line-small-title">fuel</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="fuel" class="tpl-form-input" placeholder="请输入"
                                       name="fuel"/>
                            </div>
                        </div>
                        <!--发动机铭牌号(engine_plate_num)-->
                        <div class="am-form-group">
                            <label for="enginePlateNum" class="am-u-sm-2 am-form-label">发动机铭牌号
                                <span class="tpl-form-line-small-title">enginePlateNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="enginePlateNum" class="tpl-form-input" placeholder="请输入"
                                       name="enginePlateNum"/>
                            </div>
                        </div>
                        <!--整机质量(Machine_quality)-->
                        <div class="am-form-group">
                            <label for="machineQuality" class="am-u-sm-2 am-form-label">整机质量
                                <span class="tpl-form-line-small-title">machineQuality</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="machineQuality" class="tpl-form-input" placeholder="请输入"
                                       name="machineQuality"/>
                            </div>
                        </div>
                        <!--出厂日期(date_Of_Production)-->
                        <div class="am-form-group">
                            <label for="dateOfProduction" class="am-u-sm-2 am-form-label">出厂日期
                                <span class="tpl-form-line-small-title">dateOfProduction</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="dateOfProduction" class="form-control validate[required]"
                                       onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',disabledDates:['%H-%m-%s']})"
                                       name="dateOfProduction"
                                       placeholder="请选择日期"/>
                                <div class="input-group-btn">
                                </div>
                            </div>
                        </div>
                        <!--核载质量(Nuclear_loading_quality)-->
                        <div class="am-form-group">
                            <label for="nuclearLoadingQuality" class="am-u-sm-2 am-form-label">核载质量
                                <span class="tpl-form-line-small-title">nuclearLoadingQuality</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="nuclearLoadingQuality" class="tpl-form-input" placeholder="请输入"
                                       name="nuclearLoadingQuality"/>
                            </div>
                        </div>
                        <!--buyDate(购置时间)-->
                        <div class="am-form-group">
                            <label for="buyDate" class="am-u-sm-2 am-form-label">购置时间
                                <span class="tpl-form-line-small-title">BuyDate</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="buyDate" class="form-control validate[required]"
                                       onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',disabledDates:['%H-%m-%s']})"
                                       name="buyDate"
                                       placeholder="请选择日期"/>
                                <div class="input-group-btn">
                                </div>
                            </div>
                        </div>
                        <!--铭牌号(plate_num)-->
                        <div class="am-form-group">
                            <label for="plateNum" class="am-u-sm-2 am-form-label">铭牌号
                                <span class="tpl-form-line-small-title">plateNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="plateNum" class="tpl-form-input" placeholder="请输入"
                                       name="plateNum"/>
                            </div>
                        </div>
                        <!--液压泵铭牌(hydraulic_plate_num)-->
                        <div class="am-form-group">
                            <label for="hydraulicPlateNum" class="am-u-sm-2 am-form-label">液压泵铭牌
                                <span class="tpl-form-line-small-title">hydraulicPlateNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="hydraulicPlateNum" class="tpl-form-input" placeholder="请输入"
                                       name="hydraulicPlateNum"/>
                            </div>
                        </div>
                        <!--remark(备注信息)-->
                        <div class="am-form-group">
                            <label for="remark" class="am-u-sm-2 am-form-label">备注信息
                                <span class="tpl-form-line-small-title">HydraulicPlateNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="remark" class="tpl-form-input" placeholder="请输入" name="remark"/>
                            </div>
                        </div>
                        <div class="am-form-group">
                            <div class="am-u-sm-10 am-u-sm-push-2">

                                <button type="button" onclick="return doSubmit();"
                                        class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交
                                </button>
                                <button type="button" onclick="loadPage('machineryInfo/listUI')"
                                        class="am-btn am-btn-success tpl-btn-bg-color-success ">返回
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<script th:inline="javascript">
    <![CDATA[
    //$('select').selected();
    validateUserForm();

    function validateUserForm() {
        valdater = $('#machineryInfoForm').validate({
            errorElement: 'span',
            errorClass: 'am-icon-times',
            focusInvalid: true,
            onkeyup: false,
            ignore: "",
            rules: {
                title: {
                    required: true
                }
            },
            messages: {
                name: {
                    required: "请填写标题"
                }
            }
        });
    }

    function doSubmit() {
        if (valdater.form()) {
            commit('machineryInfoForm', 'machineryInfo/save', 'machineryInfo/listUI');
            return true;
        }
        return false;
    }

    ]]>
</script>
<script type="text/javascript" th:src="@{/My97DatePicker/WdatePicker.js}"/>